<template>
  <div>
    <canvas id="canvas-1" style="width: 500px"></canvas>
  </div>
</template>

<script>
export default {
  name: "JSMpeg",
  components: {},
  data() {
    return {};
  },
  mounted() {
    this.getVideos();
  },
  methods: {
    getVideos() {
      var rtsp =
        "rtsp://admin:VYYPAX@192.168.6.130:554/h264/ch1/main/av_stream";
      // let canvas = document.getElementById("video");
      let url = "ws://localhost:9999/rtsp?url=" + btoa(rtsp);
      console.log(JSMpeg);
      let player = new JSMpeg.Player(url, {
        canvas: document.getElementById("canvas-1"),
      });
    },
  },
};
</script>

<style scoped></style>
